package com.design.twords.activity;

import android.content.Intent;
import android.os.Bundle;

import com.design.twords.R;
import com.design.twords.utils.MyApplication;

import java.util.Timer;
import java.util.TimerTask;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import cn.bmob.v3.Bmob;

/**
 * Create by Alen
 * Time:  12:16
 */
public class WelcomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_welcome);
        MyApplication.getInstance().addActivity(this);

        //启动bomb
        Bmob.initialize(this,getString(R.string.bmob_key));
        //延迟进入主界面

        Timer timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                startActivity(new Intent(WelcomeActivity.this, LoginActivity.class));
                finish();
            }
        },2000);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        MyApplication.getInstance().removeActivity(this);
    }
}
